package top.malaoshi.config;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import top.malaoshi.entity.Notice;
import top.malaoshi.model.JsonResult;

/**
 * openFeign需要定义的接口
 */
@Component
@FeignClient(value="notice-service") //notice微服务名称
public interface NoticeClient {
    //notice服务的url
    @GetMapping(value="/getNoticeById/{id}")
    public JsonResult<Notice> getNoticeById(@PathVariable("id") String id);
    //notice服务的url
    @PostMapping(value="/sendNotice")
    public JsonResult sendNotice(@RequestBody Notice notice);
}
